var status = -1;
var level = "22";
var header = "#fn黑体##fs32#B - " + level + " F\r\n\r\n";

function action(e, d, c) {
    status++;
    var b = cm.getEventManager("副本_起源之塔");
    var f = b == null ? null : b.getProperty("stage" + level);
    if (f != null && f.equals("start")) {
        cm.dispose();
        return
    }
    if (cm.getInfoQuest(42001).contains("noHelp=1")) {
        startMap(b);
        return
    }
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.curNodeEventEnd(true);
            cm.setInGameDirectionMode(true, false);
            cm.setStandAloneMode(true);
            cm.inGameDirectionEvent_AskAnswerTime(30)
        } else {
            if (status === a++) {
                cm.fieldEffect_InsertCanvas(1, 128, 0, 0, 0, 1000, 0);
                cm.inGameDirectionEvent_AskAnswerTime(1000)
            } else {
                if (status === a++) {
                    cm.inGameDirectionEvent_Monologue(header + "#fs22#好好踩被云遮住的踏板，一定要通过才行。\r\n\r\n如果踩空掉下来的话……，想都觉得可怕？\r\n\r\n万一掉落的话我会帮助你再次挑战的。别担心。", 30000)
                } else {
                    if (status === a++) {
                        cm.sendNextSNoESC("#b（要问问看这次是不是免费的吗？）")
                    } else {
                        if (status === a++) {
                            cm.sendNextSNoESC("#b（还是算了，就这样吧……）")
                        } else {
                            if (status === a++) {
                                cm.fieldEffect_InsertCanvas(0, 0, 0, 0, 1000, 0, 0);
                                cm.inGameDirectionEvent_PushMoveInfo(0, 1000, 3000, -800)
                            } else {
                                if (status === a++) {
                                    cm.inGameDirectionEvent_AskAnswerTime(6000)
                                } else {
                                    if (status === a++) {
                                        cm.inGameDirectionEvent_PushMoveInfo(1, 1000, 0, 0)
                                    } else {
                                        if (status === a++) {
                                            cm.inGameDirectionEvent_AskAnswerTime(5000)
                                        } else {
                                            if (status === a++) {
                                                cm.curNodeEventEnd(true);
                                                cm.setInGameDirectionMode(false, true);
                                                cm.setStandAloneMode(false);
                                                startMap(b)
                                            } else {
                                                cm.dispose()
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

function startMap(a) {
    cm.dispose();
    cm.updateHeaderUI(1, 2, cm.getEventInstance().getTimeLeft(), 0, cm.getEventInstance().getTimeLeft(), 42011);
    a.setProperty("stage" + level, "start");
    cm.getMap().getWeatherEffectNotice("小心翼翼地踏着云朵跑到出口去吧。", 147, 60000, 1);
    cm.fieldEffect_ScreenMsg("UI/UIWindowPL.img/HiddenCatch/StageImg/start")
}

function start() {
    status = -1;
    action(1, 0, 0)
};